#ifndef ENVIRONMENTINFO_H
#define ENVIRONMENTINFO_H
#include "common.h"
#include "point.h"
#include "tempprocess.h"
class EnvironmentInfo
{
public:
    double scaleFactor = 0.0;
    double scaleStep = 1.15;
    QString fileName;
    QImage currImg;
    QImage pic;
    QPixmap pmap;
    QSize realPicSize;
    QSize origPicSize;
    QSize picSize;
    QPoint lastPoint;
    QPoint imgOffset;
    QPoint polyOffset;
    QPoint offset;
    bool isDragging;
    bool isCompleteEdit;
    QPoint currMousePos;
    int mode;
    std::map<QString,Point*> *tmp;
    std::map<QPoint*,QString> *tempPt; //选择区域点集
    std::map<QString,Point*> *regionTmp;
    double tMax;
    double tMin;
    QPolygon poly; //选择区域
    QPoint centerPos;
    double rotateFactor;
    EnvironmentInfo()
    {
        tmp = new std::map<QString,Point*>();
        tempPt = new std::map<QPoint*,QString>();
        regionTmp = new std::map<QString,Point*>() ;
    }
    void operator=(EnvironmentInfo *p)
    {
        this->centerPos = p->centerPos;
        this->rotateFactor = p->rotateFactor;

        this->currImg = p->currImg;
        this->scaleFactor = p->scaleFactor;
        this->scaleStep = p->scaleStep;
        this->fileName = p->fileName;
        this->pic = p->pic;
        this->pmap = p->pmap;
        this->realPicSize = p->realPicSize;
        this->origPicSize = p->origPicSize;
        this->picSize = p->picSize;
        this->lastPoint = p->lastPoint;
        this->imgOffset = p->imgOffset;
        this->polyOffset = p->polyOffset;
        this->offset = p->offset;
        this->isDragging = false;
        this->isCompleteEdit = p->isCompleteEdit;
        this->mode = p->mode;
        this->tmp = p->tmp;
        this->tempPt = p->tempPt;
        this->poly = p->poly;
        this->currMousePos = QPoint(0,0);
        this->regionTmp = p->regionTmp;
        this->tMax = p->tMax;
        this->tMin = p->tMin;
    }
    void toString()
    {
        qDebug() << fileName <<"," << imgOffset << "\n";
    }
};

#endif // ENVIRONMENTINFO_H
